﻿function btnOk_Click() {
    var txtNomeVal = $('#txtNome').val();
    var data = "{ nome : '" + txtNomeVal +"' }";
    var success = function (msg) {  alert(msg.d);  };
    var method = "GetHello";

    makeAjax(data, success, method);
}

function makeAjax(data,success,method) 
{
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://localhost:8005/Services/pages/index.asmx/" + method,
        data: data,
        dataType: "json",
        success: success,
        error: function () { alert('Erro on ajax response !'); }
    });
}


$(function () {
    
});